﻿# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)

project("jem")
SET(EXE_NAME "jem")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_BIN_PATH})


include_directories(
    "${CMAKE_CURRENT_SOURCE_DIR}/tools"
)


source_group("tools" FILES ${TOOLS_INC_LIST})
source_group("main" FILES main.cpp)

set(THIRD_FILES
""
)


option(IS_USE_JEMALLOC "use jemalloc" ON)
if(IS_USE_JEMALLOC)
add_definitions(-DUSE_JEMALLOC)
file(GLOB JEMALLOC_FILES "J:/openLib/jemalloc-cmake/include/*.h" "J:/openLib/jemalloc-cmake/include/msvc_compat/*.h")
file(APPEND ${THIRD_FILES} ${JEMALLOC_FILES})
endif()

set(THIRD_INCLUDE_DIRS
"J:/openLib/jemalloc-cmake/include"
"J:/openLib/jemalloc-cmake/include/msvc_compat"
)

set(THIRD_LIBRARY_DIRS 
"J:/openLib/jemalloc-cmake/build/Debug"
)



add_executable(${EXE_NAME} main.cpp ${TOOLS_INC_LIST} ${THIRD_FILES})

target_compile_options(${EXE_NAME} PRIVATE /source-charset:utf-8 /execution-charset:utf-8)

target_include_directories(${EXE_NAME} PRIVATE ${THIRD_INCLUDE_DIRS})

target_link_directories(${EXE_NAME} PRIVATE ${THIRD_LIBRARY_DIRS})

target_link_libraries(${EXE_NAME} PRIVATE
    DbgHelp
    d3d12
    d3dcompiler
    dxgi
    as_tools
    ImGuiFileDialog
    jemallocso
)

#set_property(TARGET ${EXE_NAME} PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_BIN_PATH}/bin")

